import request from '@/utils/request'
import upload from '../../utils/upload'

//查询我创建的球队
export function myCreateTeam() {
	return request({
		url: '/team/teams/myCreateTeam',
		method: 'get'
	})
}

// 上传球队封面
export function uploadCover(data) {
	return upload({
		url: '/system/oss/upload',
		name: data.name,
		filePath: data.filePath
	})
}

// 查询球队列表
export function listTeams(query) {
	return request({
		url: '/team/teams/list',
		method: 'get',
		params: query
	})
}

// 查询球队详细
export function getTeams(id) {
	return request({
		url: '/team/teams/' + id,
		method: 'get'
	})
}

// 新增球队
export function addTeams(data) {
	return request({
		url: '/team/teams',
		method: 'post',
		data: data
	})
}

// 修改球队
export function updateTeams(data) {
	return request({
		url: '/team/teams',
		method: 'put',
		data: data
	})
}

// 删除球队
export function delTeams(id) {
	return request({
		url: '/team/teams/' + id,
		method: 'delete'
	})
}